﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebCommit.Common.Entitys;

namespace WebCommit.Common.Interfaces
{
	public interface IUserSvc
	{
		/// <summary>
		/// 用户名是否存在
		/// </summary>
		/// <param name="userName"></param>
		/// <returns></returns>
		bool IsUserNameExists(string userName);

		/// <summary>
		/// 昵称是否存在
		/// </summary>
		/// <param name="userName"></param>
		/// <returns></returns>
		bool IsNickNameExists(string userName);

		/// <summary>
		/// 用户注册
		/// </summary>
		/// <param name="user"></param>
		void RegUser(UserEntity user);

		/// <summary>
		/// 修改用户信息
		/// </summary>
		/// <param name="user"></param>
		void UpdateUser(UserEntity user);

		/// <summary>
		/// 登录，并返回用户实体
		/// </summary>
		/// <param name="userName"></param>
		/// <param name="password"></param>
		/// <returns></returns>
		UserEntity Login(string userName, string password);

		UserEntity GetUserEntity(string userName);

		/// <summary>
		/// 重新发送验证邮件
		/// </summary>
		/// <param name="email">原Email</param>
		/// <param name="userId">用户Id</param>
		/// <param name="newEmail">新Email</param>
		bool ReSendValidateMail(string email,string userId,string newEmail);

		/// <summary>
		/// 验证注册用户
		/// </summary>
		/// <param name="regVal"></param>
		/// <returns></returns>
		bool ValidateUser(RegValidateEntity regVal, ref object rtnObj);

		/// <summary>
		/// 获取用户附加信息
		/// </summary>
		/// <param name="userId"></param>
		/// <returns></returns>
		UserAttachEntity GetUserAttach(string userId);
	}
}
